export function pieChartLeakageFun(data,chartsId) {


  let myChart = echarts.init(document.getElementById(chartsId))
  let option = {
    title: [
      {
        text: data.total,
        top: 'center',
        left: 'center',
        textStyle: {
          color: '#6DFFFF',
          fontSize: 40,
          fontFamily: 'SourceHanSansCN',
        },
      },
    ],
    tooltip: {
      trigger: 'item',
      formatter: '{b} : {c}'
    },
    series: [
      {
        type: 'pie',
        radius: ['50%', '65%'],
        center: ['50%', '50%'],
        z: 10,
        label: {
          show: false,
          position: 'center',
          formatter: (params) => {
            return params.name + "\r\n" + params.value
          },
          rich: {
            total: {
              fontSize: 16,
              color: '#04F5FE',
            },
            efficiency: {
              fontSize: 12,
              color: '#00FD6D',
            },
          },
          color: '#FFFFFF',
          fontSize: 12,
          lineHeight: 16,
        },
        data: data.data1,
        labelLine: {
          show: false,
        },
      },
      {
        type: 'pie',
        radius: ['35%', '60%'],
        center: ['50%', '50%'],
        label: {
          show: false,
        },
        data: data.data2,
        labelLine: {
          show: false,
        },
      },
    ],
  };
  myChart.setOption(option,true)
}
